from sqlalchemy import Column, Integer, String
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import relation
from divirt import sqlalchemy_meta_data
from divirt import logging

log = logging.getLogger('divirt.components.host')
Base = declarative_base(metadata=sqlalchemy_meta_data)
class Host(Base):
    # Table
    __tablename__ = 'hosts'
    id = Column(Integer, primary_key=True)
    fqdn = Column(String)
    
    # Relations

    def __init__(self, fqdn=None):
        self.fqdn = fqdn

    def __repr__(self):
        return '<Host(id=%s, fqdn=%s)>' % (self.id, self.fqdn)
